<template>
  <AConfigProvider
    v-bind="{
      CETable: {
        transform: (data: any) => ({
          data: data.data,
          total: data.total
        }),
        transformParams: (params: any) => ({
          ...params,
          pageNo: params.page,
          page: undefined
        })
      }
    }"
  >
    <ElConfigProvider :locale="zhCn">
      <!-- 开启水印 -->
      <el-watermark
        v-if="configSetting.watermarkEnabled"
        v-bind="configSetting.font"
        :content="configSetting.watermarkContent"
        :z-index="9999"
        class="wh-full"
      >
        <router-view />
      </el-watermark>
      <router-view v-else />
    </ElConfigProvider>
  </AConfigProvider>
</template>

<script lang="ts" setup>
import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { configSetting } from './config'
</script>

<style lang="scss" scoped>
.wh-full {
  height: 100%;
}
</style>
